package sample.data.sqlite.producer.user;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import sample.data.sqlite.dao.user.UserMapperAnnotation;
import sample.data.sqlite.entity.user.UserEntity;
import sample.data.sqlite.producer.configure.Configure;

@RestController
public class UserDaoProducer {

	private final Logger logger = LoggerFactory.getLogger(this.getClass());

	@Autowired
	private Configure configure;

	@Autowired
	private UserMapperAnnotation userMapperAnnotation;

	@GetMapping("/getUser")
	public List<UserEntity> getUser() {
		logger.info("SpringApplicationName : " + configure.getSpringApplicationName() + " ServerPort : "
				+ configure.getServerPort());
		
		return userMapperAnnotation.getUser();
	}
}
